package com.lh.controller;

import com.alibaba.fastjson.JSONObject;
import com.lh.entity.table.ProblemSummaryInfo;
import com.lh.service.ProblemSummaryInfoService;
import com.lh.utils.Answer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/problemSummary")
public class ProblemSummaryInfoController {

    @Autowired
    private ProblemSummaryInfoService problemSummaryInfoService;

    @RequestMapping("/addProblemSummaryInfo")
    public Answer<Object> addProblemSummaryInfo(@RequestBody ProblemSummaryInfo problemSummaryInfo) {
        return problemSummaryInfoService.addProblemSummaryInfo(problemSummaryInfo);
    }

    @RequestMapping("/updateProblemSummaryInfo")
    public Answer<Object> updateProblemSummaryInfo(@RequestBody ProblemSummaryInfo problemSummaryInfo) {
        return  problemSummaryInfoService.updateProblemSummaryInfo(problemSummaryInfo);
    }

    @RequestMapping("/deleteProblemSummaryInfo")
    public Answer<Object> deleteProblemSummaryInfo(@RequestBody ProblemSummaryInfo problemSummaryInfo) {
        return  problemSummaryInfoService.deleteProblemSummaryInfo(problemSummaryInfo);
    }

    @RequestMapping("/selectProblemSummaryInfoPage")
    public Answer<Object> selectProblemSummaryInfoPage(@RequestBody JSONObject reqJson) {
        return problemSummaryInfoService.selectProblemSummaryInfoPage(reqJson);
    }

    @RequestMapping("/selectProblemSummaryInfoGroup")
    public Answer<Object> selectProblemSummaryInfoGroup(@RequestBody JSONObject reqJson) {
        return problemSummaryInfoService.selectProblemSummaryInfoGroup(reqJson);
    }

    @RequestMapping("/addProblemSummaryAll")
    public Answer<Object> addProblemSummaryAll(@RequestBody ProblemSummaryInfo problemSummaryInfo) {
        return problemSummaryInfoService.addProblemSummaryAll(problemSummaryInfo);
    }

    @RequestMapping("/queryProblemSummaryAll")
    public Answer<Object> queryProblemSummaryAll(@RequestBody ProblemSummaryInfo problemSummaryInfo) {
        return problemSummaryInfoService.queryProblemSummaryAll(problemSummaryInfo);
    }

    @RequestMapping("/queryProblemSummaryTree")
    public Answer<Object> queryProblemSummaryTree() {
        return problemSummaryInfoService.queryProblemSummaryTree();
    }
}